import java.util.Scanner;
import java.util.Random;
import java.lang.Math;

public class Test {
    public static boolean isPrimeNumber(int p) {

        if (p <= 1) return false;

        for (int i = 2; i * i <= p; i++) {
            if (p % i == 0) return false;
        }

        return true;
    }
    public static boolean isPrimeNumber1(int p) {

        //基于费马小定理，本身存在缺陷
        boolean judge = true;
        Random random = new Random(500);

        for (int i = 0; i < 5; i++) {
            int a;
            do {
                a = 2 + random.nextInt(p - 3); // 生成[2, p-2]范围内的随机数
            } while (a % p == 0);
            //System.out.println(a);
            if (Math.pow(a, p) % p != a % p) {
                judge = false;
                break;
            }
        }

        return judge;
    }
    public static void splitCompositeNumber(int p) {
        for (int i = 2; i * i <= p; i++) {
            while (p % i == 0) {
                System.out.print(i);
                p /= i;
                if (p > 1) {
                    System.out.print("*");
                }
            }
        }
        if (p > 1) {
            System.out.print(p);
        }
    }
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int p = in.nextInt();

        if (isPrimeNumber(p)) {
            System.out.println(p + " is a prime number");
        } else {
            System.out.println(p + " is not a prime number");
            splitCompositeNumber(p);
        }
    }
}

